//|||||||||||||||||||||||||||||||||||||||||||||||

#ifndef U2_FRAMEWORK_H
#define U2_FRAMEWORK_H


#include "U2PreRequest.h"
/**********************@@@@@@@@@@@@@@@@@@@@@
#include <OISEvents.h>
#include <OISInputManager.h>
#include <OISKeyboard.h>
#include <OISMouse.h>
 */

#ifdef U2_STATIC_LIB
#   if U2_PLATFORM == U2_PLATFORM_WIN32
#       define U2_STATIC_GLES       1
#   endif
#   if U2_PLATFORM == U2_PLATFORM_APPLE_IOS
#       define U2_IS_IOS            1
#   endif
#   ifdef U2_IS_IOS
#       define U2_STATIC_GLES       1
#       ifdef __OBJC__
#           import <UIKit/UIKit.h>
#       endif
#   endif
#   include "U2StaticPluginLoader.h"
#endif

/**********************@@@@@@@@@@@@@@@@@@@@@
#ifdef U2_IS_IOS
#   include <OISMultiTouch.h>
#endif
 */



namespace U2EG_NAMESPACE_NAME
{
class U2Root;
class U2SceneManager;
class U2RenderWindow;
class U2Camera;
class U2Viewport;
class U2Log;
class U2Timer;
}


#ifdef U2_IS_IOS
class U2Framework : public U2EG_NAMESPACE_NAME::U2Singleton<U2Framework>//, OIS::KeyListener, OIS::MultiTouchListener
#else
class U2Framework : public U2EG_NAMESPACE_NAME::U2Singleton<U2Framework>//, OIS::KeyListener, OIS::MouseListener
#endif
{
public:
	U2Framework();
	~U2Framework();
    
#ifdef U2_IS_IOS
    bool initOgre(U2EG_NAMESPACE_NAME::U2String wndTitle/*, OIS::KeyListener *pKeyListener = 0, OIS::MultiTouchListener *pMouseListener = 0*/);
#else
	bool initOgre(U2EG_NAMESPACE_NAME::U2String wndTitle/*, OIS::KeyListener *pKeyListener = 0, OIS::MouseListener *pMouseListener = 0*/);
#endif
	void updateOgre(double timeSinceLastFrame);
    
	bool isOgreToBeShutDown()const{return m_bShutDownOgre;}
    
    /**********************@@@@@@@@@@@@@@@@@@@@@
	bool keyPressed(const OIS::KeyEvent &keyEventRef);
	bool keyReleased(const OIS::KeyEvent &keyEventRef);
    
#ifdef U2_IS_IOS
	bool touchMoved(const OIS::MultiTouchEvent &evt);
	bool touchPressed(const OIS::MultiTouchEvent &evt); 
	bool touchReleased(const OIS::MultiTouchEvent &evt);
	bool touchCancelled(const OIS::MultiTouchEvent &evt);
#else
	bool mouseMoved(const OIS::MouseEvent &evt);
	bool mousePressed(const OIS::MouseEvent &evt, OIS::MouseButtonID id); 
	bool mouseReleased(const OIS::MouseEvent &evt, OIS::MouseButtonID id);
#endif
     */
	
	U2EG_NAMESPACE_NAME::U2Root*                    m_pRoot;
	U2EG_NAMESPACE_NAME::U2SceneManager*            m_pSceneMgr;
	U2EG_NAMESPACE_NAME::U2RenderWindow*            m_pRenderWnd;
	U2EG_NAMESPACE_NAME::U2Camera*                  m_pCamera;
	U2EG_NAMESPACE_NAME::U2Viewport*                m_pViewport;
	U2EG_NAMESPACE_NAME::U2Log*                     m_pLog;
	U2EG_NAMESPACE_NAME::U2Timer*                   m_pTimer;
	
    /**********************@@@@@@@@@@@@@@@@@@@@@
	OIS::InputManager*			m_pInputMgr;
	OIS::Keyboard*				m_pKeyboard;
#ifdef U2_IS_IOS
	OIS::MultiTouch*			m_pMouse;
#else
	OIS::Mouse*					m_pMouse;
#endif
     */

protected:
   // Added for Mac compatibility
   U2EG_NAMESPACE_NAME::U2String                    m_ResourcePath;
    
private:
	U2Framework(const U2Framework&);
	U2Framework& operator= (const U2Framework&);
    
    U2EG_NAMESPACE_NAME::FrameEvent                 m_FrameEvent;
	int                         m_iNumScreenShots;
    
	bool                        m_bShutDownOgre;
	
#ifdef U2_STATIC_LIB
    U2EG_NAMESPACE_NAME::StaticPluginLoader    m_StaticPluginLoader;
#endif
};

//|||||||||||||||||||||||||||||||||||||||||||||||

#endif 

//|||||||||||||||||||||||||||||||||||||||||||||||
